package com.saunter.controller;

import com.saunter.service.CompanyService;
import com.saunter.service.ThemeService;
import com.saunter.utils.response.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@Api(tags = {"网站配置"})
@RestController
@RequestMapping("/theme")
public class ThemeController {
    @Autowired
    private ThemeService themeService;
    @Autowired
    private CompanyService companyService;

    @ApiOperation("获取网站配置")
    @GetMapping("/getSiteConfig")
    public Map<String, Object> getSiteConfig() {
        Map<String, Object> site_config = new HashMap<String, Object>();
        site_config.put("site_info", companyService.getInfo());
        site_config.put("theme", themeService.getTheme());
        return Response.success(site_config);
    }

    @GetMapping("/getTheme")
    public Map<String, Object> getTheme() {
        return Response.success(themeService.getTheme());
    }
}
